  <script type="text/javascript">
    function createPopUp(popUpCode){
      var div = document.createElement('div');
      div.innerHTML = popUpCode;
      document.body.appendChild(div.firstChild);
    }
  </script>
  <style type="text/css">
  <!--
  .popUp{
    position: absolute;
    top: 150px;
    left: 200px;
    text-align: center;
    padding: 5px;
    border: 1px solid black;
    background: white;
  }
  -->
  </style>
<div class="popUp">
  <iframe src="http://google.com"></iframe><br/>
  <button onclick="this.parentNode.parentNode.removeChild(this.parentNode);">
          Close
  </button>
</div>
<input type="button" onclick='createPopUp(document.getElementById("popUpCode").value)' value="Create PopUp"/>